using UnityEngine;
using System.Collections;

public class HeroControl : MonoBehaviour
{
	public Hero hero;
	
	void Update ()
	{
		if(Input.GetMouseButtonDown(0))
			LeftClick();
		if(Input.GetKeyDown(KeyCode.Alpha1))
			hero.Attack1();
		if(Input.GetKeyDown(KeyCode.Alpha2))
			hero.Attack2();
	}
	
	private void LeftClick()
	{
		Vector3 target = Camera.main.ScreenToWorldPoint(Input.mousePosition);
		target.z = 0;
		if(!Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift))
		{
			hero.SeekTarget.Clear();
			hero.SeekTarget.AddFirst(target);
		}
		else
			hero.SeekTarget.AddLast(target);
	}
}
